import { BaseEntity } from '@cool-midway/core';
import { Column, Entity } from 'typeorm';

/**
 * 系统用户
 */
@Entity('doupiaopiao_user')
export class DoupiaopiaoUserEntity extends BaseEntity {
  @Column({ comment: '用户名', length: 100, nullable: true })
  username: string;

  @Column({ comment: '密码', nullable: true })
  password: string;

  @Column({
    comment: '密码版本, 作用是改完密码，让原来的token失效',
    default: 1,
  })
  passwordV: number;

  @Column({ comment: '微信平台openid', nullable: true })
  wxOpenid: string;

  @Column({ comment: '微信平台unionid', nullable: true })
  wxUnionid: string;

  @Column({ comment: '淘宝平台openId', nullable: true })
  tbOpenid: string;

  @Column({ comment: '抖音平台openid', nullable: true })
  dyOpenid: string;

  @Column({ comment: '抖音平台unionid', nullable: true })
  dyUnionid: string;

  @Column({ comment: '渠道id', nullable: true })
  channelId: string;

  @Column({ comment: '所属城市', nullable: true })
  city: string;

  @Column({ comment: '上级用户ID', nullable: true })
  shareUserId: number;

  @Column({
    comment: '余额',
    type: 'decimal',
    precision: 8,
    scale: 2,
    default: 0,
  })
  balance: number;

  @Column({ comment: '姓名', nullable: true })
  name: string;

  @Column({ comment: '昵称', nullable: true })
  nickName: string;

  @Column({ comment: '淘宝昵称', nullable: true })
  tbnickName: string;

  @Column({ comment: '头像', nullable: true })
  headImg: string;

  @Column({ comment: '淘宝头像', nullable: true })
  tbheadImge: string;

  @Column({ comment: '手机', nullable: true, length: 20 })
  phone: string;

  @Column({ comment: '邮箱', nullable: true })
  email: string;

  @Column({ comment: '备注', nullable: true })
  remark: string;

  @Column({ comment: '状态 0:禁用 1：启用', default: 1, type: 'tinyint' })
  status: number;

  @Column({ comment: '支付宝账号', nullable: true })
  zfbCount: string;

  @Column({ comment: 'socketId', nullable: true })
  socketId: string;
}
